import http from "@/utils/http";
import {GW,YN_STREAM} from "@/common/const";
/**
 * 南北向资金首页
 * @return {Promise} Array
 */
export function getIndexData(option) {
  const url =`${GW}/gw/ynstockinfo/client/snfund/index`;
  const params = {
    ...option,
  };
  return http.get(url,params);
}

/**
 * 南北向资金成分股列表
 * @param {String} type - 参数注释  类型:hk2sh-沪股通,hk2sz-深股通,sh2hk-港股通(沪),sz2hk-港股通(深)
 * @param {String} field - 	排序字段,不传值时默认使用 px_change_rate(涨跌幅降序)
 * @param {String} sort - 排序 asc-升序,desc-降序,缺省时默认降序
 * @return {Promise} Object
 */

export function getList(option) {
  const url = `${GW}/gw/ynstockinfo/client/snfund/stock`;
  const params = {
    pageNo: 1,
    pageSize: 10,
    type: "",
    field: "",
    sort: "",
    ...option,
  };
  return http.get(url, params); 
}



/**
 *  获取北向资金列表 
 * @param {*} marketCode 机构分类   SH:沪市  SZ: 深市  不写 全部
 * @param  currentPage 每页多少条
 * @param pageSize 第几页
 * @param endDate 报告期时间 eg:2022-03-31
 * @param  
 * @returns promise
 */
 export const getNorthBoundList = (param)=> {
    return http.get(`${YN_STREAM}/gw/ynstockinfo/client/landHk/northFundStat/list.htm`, {
        ...param
    })
}

/**
 *  获取北向资金时间列表 
 * @param {*} 
 * @param  
 * @param  最近报告期数量
 * @param 
 * @param  
 * @returns promise
 */
 export const getNorthBoundTimeList = ()=> {
    return http.get(`${YN_STREAM}/gw/ynstockinfo/client/landHk/northFundStat/dateList.htm`, {
        
    })
}
/**
 *  获取行业名称列表 
 * @param {*} 
 * @param  
 * @param  最近报告期数量
 * @param 
 * @param  
 * @returns promise
 */
 export const getblockNameList = ()=> {
    return http.get(`${YN_STREAM}/gw/ynstockinfo/client/landHk/northFundStat/blockNameList.htm`, {
        
    })
}

/**
 *  获取股票 板块列表 
 * @param {*} 
 * 
 * @returns promise
 */
 export const getblockStockList = (content)=> {
    return http.get(`http://gw.zx093.cn/gw/ynstockinfo/app/querySecurity`, {
        content
    })
}



